package com.test.encprytool.destool;

import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.test.encprytool.Des3Util;
import com.test.encprytool.EncryptTool;
import com.test.encprytool.KeyConstant;

/**
 * 新的云配加密工具在原位移加密的基础上再加上3des加密
 * Created by xxj on 2018/7/5.
 */
public class Encrypt3DesTool {

    public static void main(String args[]) {
        String rawData = EncryptTool.readFile(KeyConstant.LOCAL_FILE);
        JsonParser parser = new JsonParser();
        JsonElement obj = parser.parse(rawData);
        rawData = obj.toString();
        String result = EncryptTool.encryptOffsetByte(rawData);
        result = Des3Util.encrypt(result, KeyConstant.DECRY_3DES_KEY);

        EncryptTool.writeFile(KeyConstant.CLOUD_FILE, result);
        EncryptTool.writeFile(KeyConstant.ASSERTS_FILE, result);
    }



    //haha
}
